package com.cloud.wyf.Mapper;

import com.cloud.wyf.Entity.Leader;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LeaderMapper {

    @Select("<script>select * from leader where uid in <foreach collection='uids' separator=',' item='uid' open='(' close=')' >#{uid}</foreach></script>")
    List<Leader> selectLeaderByUids(@Param("uids") List<String> uids);

    @Select("select * from leader where uid=#{uid}")
    Leader selectById(String uid);

    @Update("update leader set status=#{status}")
    int updateStatus(int  status);

    @Select("select * from leader")
    List<Leader> selectAll();
}
